-
Notifications
You must be signed in to change notification settings - Fork 741
fix TS6053 missing file diagnostics to match tsc (#2081) #2096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix TS6053 missing file diagnostics to match tsc (#2081) #2096
Conversation
internal/compiler/program_test.go
Outdated
| }) | ||
| } | ||
|
|
||
| func TestMissingReferenceFile(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this; if you fixed the bug, the declarationEmitIndexTypeNotFound test should have been updated when you ran the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have just fixed the bug, should i open a new pull request or just commit on this request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just push to this one, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still an issue; the PR is not fixing the test I mentioned above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the last commit, I only made changes to loaderfile.go and program.go. I had previously added a new test (TestMissingReferenceFile), but it has been removed following the your guidance. Please let me know if I have misunderstood your point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the fix in this PR worked, then the test case Ryan was showing, declarationEmitIndexTypeNotFound, would fail and ask you to update the baselines, and likely other tests. The fact that this PR contains code but no test baseline changes means the fix is not working.
Are you testing this some other way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got it! so if the bug is fixed, the tests are expected to fail and I need to update the baseline, right?
Previously, I ran a test locally for debugging and compiled an erroneous .ts file to check whether the error matched what tsc would produce. After that, I ran go test, which failed. I then code again to pass the test but forgot to manually verify it again, so I just realized that my last commit didn’t actually solve the issue.
Now I have fixed the bug again and I’ve updated the baseline, but it resulted in 64 changes, and I’m not sure how to verify whether the updated baseline is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like an improvement with some regressions; if you view https://github.com/microsoft/typescript-go/pull/2096/files?file-filters%5B%5D=.go&file-filters%5B%5D=.diff (filtered to diffs), the goal would be to eliminate those by improving the fix.
Removed TestMissingReferenceFile due to changes in test structure.
|
Failed the tests, trying to resolve |
…ignatures are updated"
|
runner.go:131: Test when global file is added, the signatures are updated has unexpected diff Edit [3]:: Add new file and update main file Changes observed in incremental build: -src/main.ts:3:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found.
+src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found.
-3 /// <reference path="./fileNotFound.ts"/>
+2 /// <reference path="./fileNotFound.ts"/>
~~~~~~~~~~~~~~~~~
-Found 1 error in src/main.ts:3
+Found 1 error in src/anotherFileWithSameReferenes.ts:2 |
|
passed all the tests locally |
This reverts commit 87bd8d6.
I tried to fix the bug, but I am unable to resolve the parentFile and textLoc for the Diagnostic (I did note by commenting). However, it now raises an error when reference directive file path doesn't exist.